package cn.cdeden.resource.domain.domain;

import cn.cdeden.resource.domain.SysOssBarrel;
import cn.cdeden.resource.domain.dto.FilePrintLogDto;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.bean.copier.CopyOptions;
import com.baomidou.mybatisplus.annotation.*;
import io.github.linpeilie.annotations.AutoMapper;
import lombok.*;
import lombok.experimental.Accessors;
import java.io.Serializable;
import java.util.Date;

/**
* @author GW
* @date 2024-05-23
*/
@Data
@Builder
@Accessors(chain = true)
@NoArgsConstructor
@AllArgsConstructor
@EqualsAndHashCode(callSuper = false)
@TableName("sys_oss_print")
@AutoMapper(target = FilePrintLogDto.class)
public class FilePrintLog implements Serializable {
    private static final long serialVersionUID = 1L;


    @TableId(type= IdType.AUTO)
    private String id;

    private Long printerId;

    @TableField(fill= FieldFill.INSERT)
    private Date createTime;

    private Integer count;

    private Long treeNodeId;

    private String libraryType;

    public void copyFrom(FilePrintLog source){
        BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
    }
}
